import { FC,useCallback,useEffect, useMemo, useState } from 'react';
import { useNavigate } from 'react-router';
import UseMemoCom from '../componenst/useMemoCom'
import UseCallBackCom from '../componenst/useCallback'
const Index: FC<any> = (props:any): JSX.Element => {

    const [count,setCount]=useState(0);
    const [title,setTitle]=useState("您好");

    const fn=useCallback(()=>{
        console.log(11111111111);
    },[])
    //  const fn=()=>{
    //     console.log(11111111111);
        
    //  }

    useEffect(()=>{
    },[])

    return (
      <div>useMemo

        <div>

            <UseCallBackCom fn={fn}></UseCallBackCom>
            {count}
            <div>
            {title}
            </div>

            {
                useMemo(()=><UseMemoCom />,[])
            }
            
            <button onClick={()=>setTitle("hello")}>修改title</button>
            <button onClick={()=>setCount(count+1)}>修改</button>
        </div>
      </div>
    )
}
export default Index;